<?php
/**
 * 取得IP
 *
 *
 * @return string 字符串类型的返回结果
 */
function getIp(){
	if (@$_SERVER['HTTP_CLIENT_IP'] && $_SERVER['HTTP_CLIENT_IP']!='unknown') {
		$ip = $_SERVER['HTTP_CLIENT_IP'];
	} elseif (@$_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['HTTP_X_FORWARDED_FOR']!='unknown') {
		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	} else {
		$ip = $_SERVER['REMOTE_ADDR'];
	}
	return preg_match('/^\d[\d.]+\d$/', $ip) ? $ip : '';
}
/**
 * 取得会员头像
 *
 *
 * @return string 字符串类型的返回结果
 */
function getMemberHeadImg($head_pic){
	if (empty($head_pic)) {
		$path = 'http://'.input('server.HTTP_HOST').'/static'.'/img'.'/logn.jpg';
	}else{
		$path = 'http://'.input('server.HTTP_HOST').'/static'.'/update'.'/logn.jpg';
	}
	return $path;
}